<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>事件绑定</title>
    <script>
        window.onload = function(){
            document.getElementById("btn").onclick = function(){
                console.log("这是动态绑定的事件");
            }
        }
        function f1(){
            console.log("这是静态绑定的事件");
        }
        function f3(){
            console.log("我正在双击");
        }
    </script>
</head>
<body>
<button onclick="f1()">静态绑定</button><br>
<button id="btn">动态绑定</button><br>
<button ondblclick="f3()">双击事件</button>
</body>
</html>
<!--<script>-->
    <!--document.getElementById("btn").onclick = function(){
        console.log("这是动态绑定的事件");
    }-->
<!--</script>-->
